package com.happe.foodeasy.service.impl;

import com.happe.foodeasy.client.CommodityClient;
import com.happe.foodeasy.dto.CommodityBaseDTO;
import com.happe.foodeasy.dto.CommodityTypeDTO;
import com.happe.foodeasy.dto.PageInfoDto;
import com.happe.foodeasy.service.CommodityService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class CommodityServiceImpl implements CommodityService {
    @Resource
    private CommodityClient commodityClient;

    @Override
    public long selectTotalCountByParam(long commodityTypeId, long commodityStateId) {
        return commodityClient.selectTotalCountByParam(commodityTypeId, commodityStateId);
    }

    @Override
    public List<CommodityBaseDTO> selectTargetCommodityByParam(long commodityTypeId,  PageInfoDto pageInfoDto) {
        return commodityClient.selectTargetCommodityByParam(commodityTypeId,pageInfoDto);
    }

    @Override
    public List<CommodityTypeDTO> selectAllCommodityType() {
        return commodityClient.selectAllCommodityType();
    }
}
